
package org.movee.spring.data.hugegraph.query;

import com.baidu.hugegraph.driver.HugeClient;
import org.movee.spring.data.hugegraph.convert.HugeConverter;
import org.movee.spring.data.hugegraph.gremlin.GremlinTraversal;
import org.movee.spring.data.hugegraph.schema.SchemaInitiator;

import java.util.List;

/**
 * Provider interface for basic Operations with Gremlin
 */
public interface HugeOperations {

    <T> T save(final T entity, final Class<T> entityClass);

    <T> List<T> saveAll(final Iterable<T> entity, final Class<T> entityClass);

    <T> void justSaveAll(final Iterable<T> entity, final Class<T> entityClass);

    <T> T findById(final Object id, final Class<T> entityClass);

    <T> List<T> findAllById(final Iterable<Object> ids, final Class<T> entityClass);

    <T> boolean existsById(final Object id, final Class<T> entityClass);

    <T> void deleteById(final Object id, final Class<T> entityClass);

    <T> void delete(final T entity, final Class<T> entityClass);

    <T> void deleteAllById(final Iterable<Object> ids, final Class<T> entityClass);

    <T> void deleteAll(final Iterable<T> entities, final Class<T> entityClass);

    <T> List<Object> traversal(final GremlinTraversal traversal, final Class<T> entityClass);

    HugeConverter getConverter();

    HugeClient getHugeClient();

    SchemaInitiator getSchemaInitiator();
}
